import Vue from 'vue';
import VueRouter from 'vue-router'

import Home from '../page/Home'
import News from '../page/News'
import User from '../page/User'
import NotFound from '../page/NotFound'
Vue.use(VueRouter);

let routes = [
    {
        path: '/',
        redirect:'/home'
    },
    {
        path: '/home',
        name:'home',
        component: Home,
        meta: {
            title:'首页'
        }
    },
    {
        path: '/news',
        component: News,
        meta: {
            title: '新闻'
        }
    },
    {
        path: '/user',
        component: User,
        meta: {
            title: '用户'
        }
    },
    {
        path: '*',
        name:'404',
        component: NotFound
    }
]


let router = new VueRouter({
    routes,
    mode: 'history',
    linkActiveClass:'active'
})

export default router;